package com.knight.study.patterns.tujie.singleton;

/**
 * 饿汉模式
 * @Author knight
 * @Date 2024/9/10 15:50
 */

public class Singleton {
    private static Singleton singleton = new Singleton();
    private Singleton() {
        System.out.println("生成了一个实例。");
    }

    public static Singleton getInstance() {
        return singleton;
    }
}
